package ink.xiaobaibai.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author xiaobaibai
 * @since 2021-05-11
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("admin_user")
@NoArgsConstructor
public class AdminUser implements Serializable {

    private static final long serialVersionUID = 1L;

    public AdminUser(Integer id, String userName, String userPhone, String userPassword, Integer departmentId) {
        this.id = id;
        this.userName = userName;
        this.userPhone = userPhone;
        this.userPassword = userPassword;
        this.departmentId = departmentId;
    }

    public AdminUser(String userName, String userNumber, String userPhone, String userPassword) {
        this.userName = userName;
        this.userNumber = userNumber;
        this.userPhone = userPhone;
        this.userPassword = userPassword;
    }

    public AdminUser(String userName, String userNumber, Integer departmentId, String userPhone, String userPassword) {
        this.userName = userName;
        this.userNumber = userNumber;
        this.departmentId = departmentId;
        this.userPhone = userPhone;
        this.userPassword = userPassword;
    }

    /**
     * 用户表主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户昵称/姓名
     */
    @TableField("user_name")
    private String userName;

    /**
     * 用户账号
     */
    @TableField("user_number")
    private String userNumber;

    /**
     * 部门id
     */
    @TableField("department_id")
    private Integer departmentId;

    /**
     * 用户手机号
     */
    @TableField("user_phone")
    private String userPhone;

    /**
     * 用户密码(加密)
     */
    @TableField("user_password")
    private String userPassword;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;


}
